package controllers

import (
	"blackgo/config/msg"
	"blackgo/utils"
	"encoding/json"
	"fmt"
	"net/http"
)

var response utils.Response

func ResponseInit() {
	response = msg.Common["sys_success_msg"]
}

func ResponseJson(w http.ResponseWriter) {
	retMap, err := json.Marshal(response)
	if err != nil {
		fmt.Println("json.Marshal failed:", err)
	} else {
		fmt.Fprintf(w, string(retMap))
	}
}
